/*
 * @Description: 
 * @Autor: lily
 * @Date: 2021-05-07 16:17:06
 * @LastEditors: 铃兰 wangll@publink.cn
 * @LastEditTime: 2023-11-24 17:14:20
 */
import http from '@src/util/http' 
let prefix = '/api/paas';
/** 
 * @description 创建自定义应用
 * @param {Object} params 参数对象
 */
export function creatInsert(params = {}, emulateJSON = true, option = {} ) {
  return http.post(`${prefix}/outside/pc/app/insert`, params, true, option)
}

/**
 * @description 搜索表单内容
 * @param {Object}
 */
export const searchList = (params = {}) => {
  return http.post(`${prefix}/outside/es/formContent/searchList`, params);
};

/**
 * @description 查询表单字段
 * @param {Object}
 */
export const getFormFieldListInfo = (params = {}) => {
  return http.get(`${prefix}/outside/pc/formField/getFormFieldInfo`, params, false);
};

/**
* @description 获取流程状态以及流程对应的数量
* @param {Object}
*/
export const statusNum = (params = {}) => {
  return http.get(`${prefix}/outside/pc/processor/status/num`, params);
};

/**
* @description 获取关联表单的数据来源
* @param {Object}
*/
export function getAppPageApi(params = {}) {
  return http.get(`${prefix}/outside/pc/app/getAccessApp`, params);
}
/**
* @description 获取关联表单的展示数据
* @param {Object}
*/
export function getPaasFieldInfoByQueyApi(params = {}) {
  return http.get('/api/task/outside/pc/setting/getPaasFieldInfoByQuey', params);
}

/**
 * 获取灰度控制结果
 * @param {Object} params - 参数
 * @returns {*}
 */
 export function getTenantGray(params= {}) {
  return http.get(`${prefix}/outside/pc/form/auth/getGrayFunction`, params);
}

/**
 * @description 查询流程信息
 * @param {Object} params -- 参数对象
 * @param {String} params.formTemplateId -- 表单模板id
 * @param {String} params.appId -- 应用id
 */
 export function getProcess(params = {}) {
  return http.get(`${prefix}/outside/pc/processor/get`, params);
}


/**
 * @description 创建或者更新消息模板
 * @param {Object} params -- 
 */
 export function createOrUpdateMessageRule(params = {}) {
  return http.post(`${prefix}/outside/pc/message/rule/createMessageRuleList`, params);
}

/**
 * @description 获取素有消息列表
 * @param {Object} params -- 
 */
 export function getMessageRuleList(params = {}) {
  return http.get(`${prefix}/outside/pc/message/rule/getMessageRuleList`, params);
}


/**
 * @description 获取所有App列表
 * @param {Object} params -- 
 */
 export function getAppList(params = {}) {
  return http.post(`${prefix}/outside/pc/app/page`, params);
}

/**
 * @description 获取所有App列表下表单列表
 * @param {Object} params -- 
 */
 export function getAppFormList(params = {}) {
  return http.get(`${prefix}/outside/pc/app/getAllForm`, params);
}



/**
 * @description 自定义消息规则根据nodeId删除
 * @param {Object} params -- 
 */
 export function delCustomMessageForNodeId(params = {}) {
  return http.post(`${prefix}/outside/pc/message/rule/deleteRuleByNodeIds`, params);
}

/**
 * @description 自定义消息规则根据bizId删除
 * @param {Object} params -- 
 */
 export function delCustomMessageForBizId(params = {}) {
  return http.post(`${prefix}/outside/pc/message/rule/deleteRuleByBizIds`, params);
}

/**
 * @description 查询paas表单应用
 * @param {Object} params -- 
 */
export function getPaasApply(params = {}) {
  return http.get(`${prefix}/outside/pc/formField/selectProcessForm`, params);
}

/**
 * @description 查询有数据的流程表单
 * @param {Object} params -- 
 */
export function getHaveDateTemplate(params = {}) {
  return http.get(`${prefix}/outside/pc/formField/getHaveDateTemplate`, params);
}

/**
 * @description 查询paas结算数据列表
 * @param {Object} params -- 
 */
export function getPaasDataPage(params = {}) {
  return http.post('/api/customer/outside/customer/settlement/getPaasDataPage', params);
}

/**
 * 获取所有表单模板
 * @param {*} params
 * @returns Promise<Team>
 */
export const getAllTemplateList = (params = {}) =>
  http.get(`${prefix}/outside/pc/formField/getAllTemplateInfoList`, params);

/**
 * @description 查询表单字段 - 可以查pass打印字段
 * @param {Object}
 */
export const getSmsFormField = (params = {}) => {
  return http.get(`${prefix}/outside/pc/formField/getSmsFormField`, params, false);
};

export function getJsComponentValidate(params) {
  return http.post(`${prefix}/outside/pc/cookieValidate/js`, params);
}